<%@ page import="com.xueqi.bean.EbookEntry" %>
<%@ page import="java.util.List" %>
<%@ page import="com.xueqi.bean.EbookCategory" %><%--
  Created by IntelliJ IDEA.
  User: pc
  Date: 2019/10/28
  Time: 19:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script>
        function bck() {
            location.href="/entry";
        }
    </script>
</head>
<body>
<h1>更新电子图书</h1>
<%EbookEntry entry=(EbookEntry)request.getAttribute("entry");%>
            <form action="/entry" method="post">
                <input type="hidden" name="method" value="update">
                <input type="hidden" name="id" value="<%=entry.getId()%>">
    <table>
        <tr>
            <td>图书编号：</td>
            <td><%=entry.getId()%></td>
        </tr>
        <tr>
            <td>图书名称：</td>
            <td><input type="text" name="bookname" value="<%=entry.getTitle()%>"></td>
        </tr>
        <tr>
            <td>图书摘要：</td>
            <td><textarea rows="5" cols="20" name="content"  ><%=entry.getSummary()%></textarea></td>
        </tr>
        <tr>
            <td>分类</td>
            <td><select name="type">
                <%List<EbookCategory> list = (List<EbookCategory>)request.getAttribute("typelist");
                for(EbookCategory category:list){
                %>
                <option value="<%=category.getId()%>" <%if(category.getId()==entry.getCategoryid()){%> selected<%}%>><%=category.getName()%></option>
                <%}%>
            </select></td>
        </tr>
        <tr>
            <td>上传人：</td>
            <td><input type="text" name="username" value="<%=entry.getUploaduser()%>"></td>
        </tr>
        <tr>
            <td>上传时间：</td>
            <td><input type="text" name="time" value="<%=entry.getCreatedate()%>"></td>
        </tr>
        <tr>
            <td><input type="submit" name="submit" value="更新"></td>
            <td><input type="button" value="返回" onclick="bck()"></td>
        </tr>
    </table>
</form>
</body>
</html>
